Internet Archive BookReader - General theory of most efficient codes